Optimal. Leaf size=83 \[ -\frac {i (c+d x)^2}{b}-\frac {(c+d x)^2 \cot (a+b x)}{b}+\frac {2 d (c+d x) \log \left (1-e^{2 i (a+b x)}\right )}{b^2}-\frac {i d^2 \text {Li}_2\left (e^{2 i (a+b x)}\right )}{b^3} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.10, antiderivative size = 83, normalized size of antiderivative = 1.00, number of steps
used = 5, number of rules used = 5, integrand size = 16, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.312, Rules used = {4269, 3798,
2221, 2317, 2438} \begin {gather*} -\frac {i d^2 \text {PolyLog}\left (2,e^{2 i (a+b x)}\right )}{b^3}+\frac {2 d (c+d x) \log \left (1-e^{2 i (a+b x)}\right )}{b^2}-\frac {(c+d x)^2 \cot (a+b x)}{b}-\frac {i (c+d x)^2}{b} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 2221
Rule 2317
Rule 2438
Rule 3798
Rule 4269
Rubi steps
\begin {align*} \int (c+d x)^2 \csc ^2(a+b x) \, dx &=-\frac {(c+d x)^2 \cot (a+b x)}{b}+\frac {(2 d) \int (c+d x) \cot (a+b x) \, dx}{b}\\ &=-\frac {i (c+d x)^2}{b}-\frac {(c+d x)^2 \cot (a+b x)}{b}-\frac {(4 i d) \int \frac {e^{2 i (a+b x)} (c+d x)}{1-e^{2 i (a+b x)}} \, dx}{b}\\ &=-\frac {i (c+d x)^2}{b}-\frac {(c+d x)^2 \cot (a+b x)}{b}+\frac {2 d (c+d x) \log \left (1-e^{2 i (a+b x)}\right )}{b^2}-\frac {\left (2 d^2\right ) \int \log \left (1-e^{2 i (a+b x)}\right ) \, dx}{b^2}\\ &=-\frac {i (c+d x)^2}{b}-\frac {(c+d x)^2 \cot (a+b x)}{b}+\frac {2 d (c+d x) \log \left (1-e^{2 i (a+b x)}\right )}{b^2}+\frac {\left (i d^2\right ) \text {Subst}\left (\int \frac {\log (1-x)}{x} \, dx,x,e^{2 i (a+b x)}\right )}{b^3}\\ &=-\frac {i (c+d x)^2}{b}-\frac {(c+d x)^2 \cot (a+b x)}{b}+\frac {2 d (c+d x) \log \left (1-e^{2 i (a+b x)}\right )}{b^2}-\frac {i d^2 \text {Li}_2\left (e^{2 i (a+b x)}\right )}{b^3}\\ \end {align*}
________________________________________________________________________________________
Mathematica [B] Both result and optimal contain complex but leaf count is larger than twice
the leaf count of optimal. \(181\) vs. \(2(83)=166\).
time = 2.54, size = 181, normalized size = 2.18 \begin {gather*} \frac {\csc (a) \left (-2 b c d (b x \cos (a)-\log (\sin (a+b x)) \sin (a))+d^2 \left (-b^2 e^{i \tan ^{-1}(\tan (a))} x^2 \cos (a) \sqrt {\sec ^2(a)}-\left (-i b x \left (\pi -2 \tan ^{-1}(\tan (a))\right )-\pi \log \left (1+e^{-2 i b x}\right )-2 \left (b x+\tan ^{-1}(\tan (a))\right ) \log \left (1-e^{2 i \left (b x+\tan ^{-1}(\tan (a))\right )}\right )+\pi \log (\cos (b x))+2 \tan ^{-1}(\tan (a)) \log \left (\sin \left (b x+\tan ^{-1}(\tan (a))\right )\right )+i \text {Li}_2\left (e^{2 i \left (b x+\tan ^{-1}(\tan (a))\right )}\right )\right ) \sin (a)\right )+b^2 (c+d x)^2 \csc (a+b x) \sin (b x)\right )}{b^3} \end {gather*}
Warning: Unable to verify antiderivative.
[In]
[Out]
________________________________________________________________________________________
Maple [B] Both result and optimal contain complex but leaf count of result is larger than twice
the leaf count of optimal. 275 vs. \(2 (77 ) = 154\).
time = 0.06, size = 276, normalized size = 3.33
method | result | size |
risch | \(-\frac {2 i \left (d^{2} x^{2}+2 c d x +c^{2}\right )}{b \left ({\mathrm e}^{2 i \left (b x +a \right )}-1\right )}+\frac {2 d c \ln \left ({\mathrm e}^{i \left (b x +a \right )}-1\right )}{b^{2}}-\frac {4 d c \ln \left ({\mathrm e}^{i \left (b x +a \right )}\right )}{b^{2}}+\frac {2 d c \ln \left ({\mathrm e}^{i \left (b x +a \right )}+1\right )}{b^{2}}-\frac {2 i d^{2} x^{2}}{b}-\frac {4 i d^{2} a x}{b^{2}}-\frac {2 i d^{2} a^{2}}{b^{3}}+\frac {2 d^{2} \ln \left (1-{\mathrm e}^{i \left (b x +a \right )}\right ) x}{b^{2}}+\frac {2 d^{2} \ln \left (1-{\mathrm e}^{i \left (b x +a \right )}\right ) a}{b^{3}}-\frac {2 i d^{2} \polylog \left (2, {\mathrm e}^{i \left (b x +a \right )}\right )}{b^{3}}+\frac {2 d^{2} \ln \left ({\mathrm e}^{i \left (b x +a \right )}+1\right ) x}{b^{2}}-\frac {2 i d^{2} \polylog \left (2, -{\mathrm e}^{i \left (b x +a \right )}\right )}{b^{3}}-\frac {2 d^{2} a \ln \left ({\mathrm e}^{i \left (b x +a \right )}-1\right )}{b^{3}}+\frac {4 d^{2} a \ln \left ({\mathrm e}^{i \left (b x +a \right )}\right )}{b^{3}}\) | \(276\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [B] Both result and optimal contain complex but leaf count of result is larger than
twice the leaf count of optimal. 552 vs. \(2 (74) = 148\).
time = 0.38, size = 552, normalized size = 6.65 \begin {gather*} -\frac {2 \, b^{2} c^{2} + 2 \, {\left (b d^{2} x + b c d - {\left (b d^{2} x + b c d\right )} \cos \left (2 \, b x + 2 \, a\right ) + {\left (-i \, b d^{2} x - i \, b c d\right )} \sin \left (2 \, b x + 2 \, a\right )\right )} \arctan \left (\sin \left (b x + a\right ), \cos \left (b x + a\right ) + 1\right ) - 2 \, {\left (b c d \cos \left (2 \, b x + 2 \, a\right ) + i \, b c d \sin \left (2 \, b x + 2 \, a\right ) - b c d\right )} \arctan \left (\sin \left (b x + a\right ), \cos \left (b x + a\right ) - 1\right ) + 2 \, {\left (b d^{2} x \cos \left (2 \, b x + 2 \, a\right ) + i \, b d^{2} x \sin \left (2 \, b x + 2 \, a\right ) - b d^{2} x\right )} \arctan \left (\sin \left (b x + a\right ), -\cos \left (b x + a\right ) + 1\right ) + 2 \, {\left (b^{2} d^{2} x^{2} + 2 \, b^{2} c d x\right )} \cos \left (2 \, b x + 2 \, a\right ) + 2 \, {\left (d^{2} \cos \left (2 \, b x + 2 \, a\right ) + i \, d^{2} \sin \left (2 \, b x + 2 \, a\right ) - d^{2}\right )} {\rm Li}_2\left (-e^{\left (i \, b x + i \, a\right )}\right ) + 2 \, {\left (d^{2} \cos \left (2 \, b x + 2 \, a\right ) + i \, d^{2} \sin \left (2 \, b x + 2 \, a\right ) - d^{2}\right )} {\rm Li}_2\left (e^{\left (i \, b x + i \, a\right )}\right ) - {\left (i \, b d^{2} x + i \, b c d + {\left (-i \, b d^{2} x - i \, b c d\right )} \cos \left (2 \, b x + 2 \, a\right ) + {\left (b d^{2} x + b c d\right )} \sin \left (2 \, b x + 2 \, a\right )\right )} \log \left (\cos \left (b x + a\right )^{2} + \sin \left (b x + a\right )^{2} + 2 \, \cos \left (b x + a\right ) + 1\right ) - {\left (i \, b d^{2} x + i \, b c d + {\left (-i \, b d^{2} x - i \, b c d\right )} \cos \left (2 \, b x + 2 \, a\right ) + {\left (b d^{2} x + b c d\right )} \sin \left (2 \, b x + 2 \, a\right )\right )} \log \left (\cos \left (b x + a\right )^{2} + \sin \left (b x + a\right )^{2} - 2 \, \cos \left (b x + a\right ) + 1\right ) + 2 \, {\left (i \, b^{2} d^{2} x^{2} + 2 i \, b^{2} c d x\right )} \sin \left (2 \, b x + 2 \, a\right )}{-i \, b^{3} \cos \left (2 \, b x + 2 \, a\right ) + b^{3} \sin \left (2 \, b x + 2 \, a\right ) + i \, b^{3}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Both result and optimal contain complex but leaf count of result is larger than twice
the leaf count of optimal. 379 vs. \(2 (74) = 148\).
time = 0.38, size = 379, normalized size = 4.57 \begin {gather*} \frac {-i \, d^{2} {\rm Li}_2\left (\cos \left (b x + a\right ) + i \, \sin \left (b x + a\right )\right ) \sin \left (b x + a\right ) + i \, d^{2} {\rm Li}_2\left (\cos \left (b x + a\right ) - i \, \sin \left (b x + a\right )\right ) \sin \left (b x + a\right ) + i \, d^{2} {\rm Li}_2\left (-\cos \left (b x + a\right ) + i \, \sin \left (b x + a\right )\right ) \sin \left (b x + a\right ) - i \, d^{2} {\rm Li}_2\left (-\cos \left (b x + a\right ) - i \, \sin \left (b x + a\right )\right ) \sin \left (b x + a\right ) + {\left (b d^{2} x + b c d\right )} \log \left (\cos \left (b x + a\right ) + i \, \sin \left (b x + a\right ) + 1\right ) \sin \left (b x + a\right ) + {\left (b d^{2} x + b c d\right )} \log \left (\cos \left (b x + a\right ) - i \, \sin \left (b x + a\right ) + 1\right ) \sin \left (b x + a\right ) + {\left (b c d - a d^{2}\right )} \log \left (-\frac {1}{2} \, \cos \left (b x + a\right ) + \frac {1}{2} i \, \sin \left (b x + a\right ) + \frac {1}{2}\right ) \sin \left (b x + a\right ) + {\left (b c d - a d^{2}\right )} \log \left (-\frac {1}{2} \, \cos \left (b x + a\right ) - \frac {1}{2} i \, \sin \left (b x + a\right ) + \frac {1}{2}\right ) \sin \left (b x + a\right ) + {\left (b d^{2} x + a d^{2}\right )} \log \left (-\cos \left (b x + a\right ) + i \, \sin \left (b x + a\right ) + 1\right ) \sin \left (b x + a\right ) + {\left (b d^{2} x + a d^{2}\right )} \log \left (-\cos \left (b x + a\right ) - i \, \sin \left (b x + a\right ) + 1\right ) \sin \left (b x + a\right ) - {\left (b^{2} d^{2} x^{2} + 2 \, b^{2} c d x + b^{2} c^{2}\right )} \cos \left (b x + a\right )}{b^{3} \sin \left (b x + a\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \left (c + d x\right )^{2} \csc ^{2}{\left (a + b x \right )}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [F]
time = 0.00, size = -1, normalized size = -0.01 \begin {gather*} \int \frac {{\left (c+d\,x\right )}^2}{{\sin \left (a+b\,x\right )}^2} \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________